package com.keti.DaoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.keti.Dao.AdminDao;
import com.keti.pojo.Admin;

import util.DBUtil;

public class AdminDaoImpl implements AdminDao{
	Connection conn = null;
	PreparedStatement ps =null;
	ResultSet rs = null;
	
	@Override
	public Admin Login(String account, String password) {
		conn=DBUtil.getconn();
		Admin a = null;
		try {
			ps=conn.prepareStatement("select * from admin where account=? and `password`=?");
			ps.setString(1, account);
			ps.setString(2, password);
			rs=ps.executeQuery();
			while(rs.next()) {
				a = new Admin();
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return a;
	}
	

}
